/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.j;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.f.b;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.f;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.k.c;
import java.util.Map;
import java.util.TreeMap;
import org.json.JSONObject;

public class g extends d {
    private Intent b;
    private String c;

    public g(Context paramContext, Intent paramIntent, d.a parama) {
        super(paramContext, parama, true);
        this.b = paramIntent;
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected String a() {
        return "http://mgame.360.cn/credit/getpin.json";
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        if (this.b == null) {
            c.b("OAGetMo9VerifyCodeTask", new Object[] { "Intent is null!" });
            return null;
        }
        String str1 = this.b.getStringExtra("qihoo_user_id");
        if (TextUtils.isEmpty(str1)) {
            c.b("OAGetMo9VerifyCodeTask", new Object[] { "Qid is null!" });
            return null;
        }
        String str2 = this.b.getStringExtra("access_token");
        if (TextUtils.isEmpty(str2)) {
            c.b("OAGetMo9VerifyCodeTask", new Object[] { "Access token is null!" });
            return null;
        }
        String str3 = a(0, paramArrayOfString);
        if (TextUtils.isEmpty(str3)) {
            c.b("OAGetMo9VerifyCodeTask", new Object[] { "Inner Trade Code is null!" });
            return null;
        }
        String str4 = a(1, paramArrayOfString);
        if (TextUtils.isEmpty(str4))
            c.b("OAGetMo9VerifyCodeTask", new Object[] { "Order Id is null!" });
        String str5 = a(2, paramArrayOfString);
        this.c = a(3, paramArrayOfString);
        TreeMap localTreeMap = new TreeMap();
        localTreeMap.put("user_id", str1);
        localTreeMap.put("access_token", str2);
        localTreeMap.put("inner_trade_code", str3);
        localTreeMap.put("order_id", str4);
        localTreeMap.put("app_key", s.r(paramContext));
        localTreeMap.put("mobile_num", str5);
        String str6 = s.a(localTreeMap, s.s(paramContext));
        this.a = s.b();
        String str7 = f.c(str6, this.a);
        String str8 = b.a().a(this.a);
        localTreeMap = new TreeMap();
        localTreeMap.put("k", str8);
        localTreeMap.put("d", str7);
        c.a("OAGetMo9VerifyCodeTask", new Object[] { a(), "?k=", str8, "&d=", str7 });
        return localTreeMap;
    }

    protected n.a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            int i = paramJSONObject.optInt("error_code", -1);
            String str = paramJSONObject.optString("error", "");
            int j = paramJSONObject.optInt("interval", 0);
            if (i != -1) {
                n.a locala = new n.a();
                locala.a(i);
                locala.a(str);
                switch (i) {
                case 0:
                    n.a.a(this.c, j, new String[] { str });
                }
                return locala;
            }
        }
        return null;
    }
}